import 'dart:core';

class ChangeLogItem {
  String entry;
  String date;
  String version;
  String detail;

  ChangeLogItem({this.entry, this.date, this.version, this.detail});

  // 只有 int， double， String， bool, null, List, 或者 Map 类型对象可以直接编码成 JSON。
  ChangeLogItem.fromMap(Map<String, dynamic> json)
      : entry = json['entry'],
        date = json['date'],
        version = json['version'],
        detail = json['detail'];

  Map<String, dynamic> toMap() =>
      {'entry': entry, 'date': date, 'version': version, 'detail': detail};

  String get body => '$date , $version , $detail';

  static List<ChangeLogItem> genFromList(List data) {
    return List.from(data).map((e) => ChangeLogItem.fromMap(e)).toList();
  }
}
